import { post } from '../http'
import store from '@/store'

// 班行班列计划

//查询
export const GetTrainOutsetPlanModelList=({

  tboTrain,//车次
  tboOriginstation,//始发站
  tboFinishstation,//终点站
  tboNum,//班列编号【列车编号】
  tboUpdownsigns,//上下行标志(N-上,S下)
  tboDeparturedateStart,//发车初始日期
  tboDeparturedateEnd,//发车末端日期
  PageIndexs,
  PageSizes
})=>{
  return post('/FTKJWLHYPT/Plan/GetTrainOutsetPlanModelList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tboEptId:store.state.user.FLT_UUID_DX_H,//企业id
          tboTrain,//车次
          tboOriginstation,//始发站
          tboFinishstation,//终点站
          tboNum,//班列编号
          tboUpdownsigns,//上下行标志
          tboDeparturedateStart,//发车初始时间
          tboDeparturedateEnd//发车末端时间
        }
      },
      Orderbys: {},
      PageIndexs: {
        FTKJWLHYPT: PageIndexs
      },
      PageSizes: {
        FTKJWLHYPT: PageSizes
      }
    }
  })
}





//新增计划
export const AddOrEditTrainOutsetPlan=({
  tboTbbId,//班列ID
  tboTrain,//车次
  tboTimelong,//预计时长
  tboDeparturedate,//发车日期
  tboInsidecar,//发运车板数
  tboRemark,//备注
  tboNum,//班列编号
})=>{
  return post('/FTKJWLHYPT/Plan/AddOrEditTrainOutsetPlan',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tboEptId:store.state.user.FLT_UUID_DX_H,//企业id
          tboTrain,
          tboNum,
          tboTbbId,
          tboTimelong,
          tboDeparturedate,
          tboInsidecar:Number(tboInsidecar),
          tboRemark,
          tboInsertuser:store.state.user.USR_CODE_DX_H,
        }
      }
    }
  })
}

//编辑计划
export const EditTrainOutsetPlan=({
  tboId,//计划id（主键）
  tboDeparturedate,
  tboInsidecar,
  tboRemark,
  tboInsidelastcar,
  tboNum,
  tboTimelong,
})=>{
  return post('/FTKJWLHYPT/Plan/EditTrainOutsetPlan',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tboId,//计划id（主键）
          tboDeparturedate,
          tboInsidecar,
          tboRemark,
          tboInsidelastcar,
          tboNum,
          tboTimelong,
          tboLstupduser:store.state.user.USR_CODE_DX_H,
        }
      }
    }
  })
}

export const DeleteTrainOutsetPlan=({tboId})=>{
  return post('/FTKJWLHYPT/Plan/DeleteTrainOutsetPlan',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tboId//计划id
        }
      }
    }
  })
}

//铁路信息同步

export const GetTrainMessage=({trtCasenum,PageIndexs,PageSizes})=>{
  return post('/FTKJWLHYPT/Plan/GetTrainMessage',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          trtCasenum
        }
      },
      Orderbys: {},
      PageIndexs: {
        FTKJWLHYPT: PageIndexs
      },
      PageSizes: {
        FTKJWLHYPT: PageSizes
      }
    }
  })
}
